<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class MysqlAction extends BaseAction {
    public function __construct() {
        parent::__construct();
        
    }
    
    public function index(){
        $basename=  $this->copy();
        $time=date("Y-m-d");
        $mail=$this->sendmail("{$time}财务系统数据库已成功备份",$basename);
        
        
    }
    public function copy(){
        $path=SITE_PATH."/data/";
        $basename=exec(SITE_PATH."/exec/mysql.bat $path ");
        return $path.$basename;
    }
    
    public function sendmail($name,$path=''){
        $name=iconv("UTF-8","GB2312//IGNORE",$name) ;
        exec(SITE_PATH."/exec/mail.bat $name ".SITE_PATH." $path");
        
    }
}
?>
